
layui.use(['jquery', 'layer', 'miniAdmin', 'miniTongji'], function () {
    var $ = layui.jquery,
        layer = layui.layer,
        miniAdmin = layui.miniAdmin,
        miniTongji = layui.miniTongji;
    $(function(){
        $.get('/users', {
            test_login: 1
        }, function (re) {
            if (re == 0) {
                window.location = 'index.html';
            }
        })
    })
    $('.login-out').on("click", function () {
        $.get('/users', {
            login_out: 1
        }, function (re) {
            if (re == 1) {
                layer.msg('退出登录成功', function () {
                    localStorage.setItem('name',"");
                    window.location = 'index.html';
                });
            }
        })

    });
    
});